package com.bt7274.utils;

import org.jetbrains.annotations.Nullable;

/**
 * @Data 2025/5/31 22:31
 * @Author hp
 * @Version 1.0
 * @Description BooleanUtil
 */

public class BooleanUtil {
    public static boolean parseBoolean(@Nullable String input) {
        if (input == null) return false;
        if ("1".equals(input)) return true;
        if ("true".equalsIgnoreCase(input)) return true;
        if ("yes".equalsIgnoreCase(input)) return true;
        if ("on".equalsIgnoreCase(input)) return true;
        return "y".equalsIgnoreCase(input);
    }
}
